#ifndef PluginH
#define PluginH

#include <windows.h>
#include <string>

using namespace std;

enum MessageType {
    SAY,
    YELL,
    WHISPER,
    EMOTE,
    GUILD,
    RAID,
    CHANNEL,
    SYSTEM,
    EMPTY,
    UNKNOWN
};

class Plugin {
    public:
        static Plugin *loadPlugin(string name);
        ~Plugin();

        MessageType getType(const char *msg) const;
        bool hasTime(const char *msg) const;
        string removeTime(const char *msg) const;
        const char *getName() const;

    private:

        typedef MessageType(*GetType)(const char*);
        typedef bool (*HasTime)(const char*);
        typedef string (*RemoveTime)(const char*);

        HMODULE lib;

        const char *name;

        GetType getTypeFunc;
        HasTime hasTimeFunc;
        RemoveTime removeTimeFunc;

        Plugin(HMODULE lib, const char *name, GetType gt, HasTime ht, RemoveTime rt);

};

#endif
